<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('设备修改')" />
    <th:block th:include="include :: datetimepicker-css" />
    <style type="text/css">
        table label.error{position: inherit;}select + label.error{z-index:1;right:40px;}
    </style>
</head>
<body class="gray-bg">
<div class="main-content">
    <form class="form-horizontal m" id="form-device-add" th:object="${myDevice}">

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">设备名称：</label>
                    <div class="col-sm-8">
                        <input name="name"  class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">设备串口：</label>
                    <div class="col-sm-8">
                        <input name="serialPort"  class="form-control" type="text">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">比特率：</label>
                    <div class="col-sm-8">
                        <input name="bitRate"  class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">备注：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <textarea name="remark" class="form-control"></textarea>
                        </div>
                    </div>
                </div>
            </div>

        </div>
        <!--<div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">设备运行时间：</label>
                    <div class="col-sm-8">
                        <input name="runTime"  class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">设备运行状态：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <select class='form-control' name='state' ">
                            <option value="1" >已停止</option>
                            <option value="2" >正在运行</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
        </div>-->


        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">样品舱真空度的设定值：</label>
                    <div class="col-sm-8">
                        <input name="deviceDetails.p2Seting"  class="form-control"  type="text" >
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">舱体升温速率设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.pt1Seting" class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
        </div>




        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">舱体起始温度设定值：</label>
                    <div class="col-sm-8">
                        <input name="deviceDetails.cangtiT0Seting"  class="form-control"  type="text" >
                    </div>
                </div>
            </div>

            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">捕集阱温度 低温设定值：</label>
                    <div class="col-sm-8">
                        <input name="deviceDetails.bujijingT2Now"  class="form-control"  type="text" >
                    </div>
                </div>
            </div>

        </div>



        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">捕集阱温度 高温设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.bujijingT3Seting"  class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">捕集阱传输线温度设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.bujijingT41Seting"  class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
        </div>



        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">捕集阱传输线温度设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.bujijingT42Seting"  class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">自动四通选择阀设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.t5Seting"  class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">舱体真空稳定时间设定值：</label>
                    <div class="col-sm-8">
                        <input name="deviceDetails.cangtiC1Seting"  class="form-control"  type="text" >
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">舱体恒温烘烤时间设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.cangtiC2Seting"  class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">捕集阱富集时间设定值：</label>
                    <div class="col-sm-8">
                        <input name="deviceDetails.bujijingC3Seting"  class="form-control"  type="text" >
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label is-required">捕集阱高温维持时间设定值：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="deviceDetails.bujijingC4Seting"  class="form-control"  type="text" >
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </form>
</div>

<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:src="@{/js/jquery.tmpl.js}"></script>
<script th:inline="javascript">
    var prefix = ctx + "system/device";
    $("#form-device-edit").validate({
        focusCleanup: true
    });




    /*  $.validator.addMethod("goodsName", function(value, element) {
          return !this.optional(element);
      }, "商品名称必填。");

      $.validator.addMethod("goodsWeight", function(value, element) {
          return !this.optional(element) && (value <= 100 && value >= 0);
      }, "商品重量长度区间0-100。");*/

    /* 主子表-提交 */
    function submitHandler(index, layero){
        if ($.validate.form()) {
            /* var data = $("#form-add").serializeArray();
             alert(JSON.stringify(data))
             $.operate.saveModal("/demo/operate/customer/add", data);*/

            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-device-add').serialize());
            }
        }
    }





    $("#bootstrap-table").on("post-body.bs.table", function (e, args) {
        $("input[name$='runTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true,
            pickerPosition:'top-right'
        });
    });

    $("input[name='runTime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>

<!-- 商品类型 -->
<script id="goodsTypeTpl" type="text/x-jquery-tmpl">
    <div>
    <select class='form-control' name='goods[${index}].type'>
        <option value="">所有</option>
        <option value="0" {{if type==="0"}}selected{{/if}}>寒性</option>
        <option value="1" {{if type==="1"}}selected{{/if}}>热性</option>
    </select>
    </div>
</script>